import request from '@/utils/request';
import {
    type input, type DelList, type purchaseinput, type DelPurchaseList,
    type supplierinput, type DelSupplierList, type supplierData, type Findid, type UpdatesupplierData,
    type customerinput, type DelCustomerList, type CustomerData, type FindCustomerid, type UpdateCustomerData,
    type warehouseinput, type DelWarehouseList, type WarehouseData, type FindWarehouseid, type UpdateWarehouseData
} from './type'

export function GetUserInfo() {
    return request({
        url: '/ProcurementData/GetUserInfo',
        method: 'get',
    })
}

export function GetRequisitionShow(data: input) {
    return request({
        url: '/ProcurementData/GetRequisitionShow',
        method: 'post',
        data
    })
}

export function DeleteRequisition(data: any) {
    return request({
        url: '/ProcurementData/DeleteRequisition?requisitionid=' + data,
        method: 'get',
    })
}

export function RangeDeleteRequisition(data: DelList) {
    return request({
        url: '/ProcurementData/RangeDeleteRequisition',
        method: 'post',
        data
    })
}
//-----------------------------------------------------------
export function GetSupplierInfo() {
    return request({
        url: '/PurchaseData/GetSupplierInfo',
        method: 'get',
    })
}

export function GetPurchaseOrderShow(data: purchaseinput) {
    return request({
        url: '/PurchaseData/GetPurchaseOrderShow',
        method: 'post',
        data
    })
}

export function DeletePurchaseOrder(data: any) {
    return request({
        url: '/PurchaseData/DeletePurchaseOrder?purchaseOrderid=' + data,
        method: 'get',
    })
}

export function RangeDeletePurchaseOrder(data: DelPurchaseList) {
    return request({
        url: '/PurchaseData/RangeDeletePurchaseOrder',
        method: 'post',
        data
    })
}
//---------------------------------------------------------------
export function GetSupplierShow(data: supplierinput) {
    return request({
        url: '/SupplierData/GetSupplierShow',
        method: 'post',
        data
    })
}

export function DeleteSupplier(data: any) {
    return request({
        url: '/SupplierData/DeleteSupplier?supplierId=' + data,
        method: 'get',
    })
}

export function RangeDeleteSupplier(data: DelSupplierList) {
    return request({
        url: '/SupplierData/RangeDeleteSupplier',
        method: 'post',
        data
    })
}

export function AddSupplier(data: supplierData) {
    return request({
        url: '/SupplierData/AddSupplier',
        method: 'post',
        data
    })
}

export function UpdateCanenable(data: DelSupplierList) {
    return request({
        url: '/SupplierData/UpdateCanenable',
        method: 'post',
        data
    })
}

export function UpdateDisable(data: DelSupplierList) {
    return request({
        url: '/SupplierData/UpdateDisable',
        method: 'post',
        data
    })
}

export function GetSuppLierInfo(data: Findid) {
    return request({
        url: '/SupplierData/GetSuppLierInfo?supplierId=' + data,
        method: 'get',
        data
    })
}

export function UpdateSupplier(data: UpdatesupplierData) {
    return request({
        url: '/SupplierData/UpdateSupplier',
        method: 'post',
        data
    })
}
//---------------------------------------------------
export function GetCustomerShow(data: customerinput) {
    return request({
        url: '/CustomerData/GetCustomerShow',
        method: 'post',
        data
    })
}

export function DeleteCustomer(data: any) {
    return request({
        url: '/CustomerData/DeleteCustomer?customerid=' + data,
        method: 'get',
    })
}

export function RangeDeleteCustomer(data: DelCustomerList) {
    return request({
        url: '/CustomerData/RangeDeleteCustomer',
        method: 'post',
        data
    })
}

export function UpdateCustomerCanenable(data: DelCustomerList) {
    return request({
        url: '/CustomerData/UpdateCustomerCanenable',
        method: 'post',
        data
    })
}

export function UpdateCustomerDisable(data: DelCustomerList) {
    return request({
        url: '/CustomerData/UpdateCustomerDisable',
        method: 'post',
        data
    })
}

export function AddCustomer(data: CustomerData) {
    return request({
        url: '/CustomerData/AddCustomer',
        method: 'post',
        data
    })
}

export function GetCustomerInfo(data: FindCustomerid) {
    return request({
        url: '/CustomerData/GetCustomerInfo?customerid=' + data,
        method: 'get',
        data
    })
}

export function UpdateCustomer(data: UpdateCustomerData) {
    return request({
        url: '/CustomerData/UpdateCustomer',
        method: 'post',
        data
    })
}
//--------------------------------------------------------
export function GetWarehouseShow(data: warehouseinput) {
    return request({
        url: '/WarehouseData/GetWarehouseShow',
        method: 'post',
        data
    })
}

export function DeleteWarehouse(data: any) {
    return request({
        url: '/WarehouseData/DeleteWarehouse?depot_id=' + data,
        method: 'get',
    })
}

export function RangeDeleteWarehouse(data: DelWarehouseList) {
    return request({
        url: '/WarehouseData/RangeDeleteWarehouse',
        method: 'post',
        data
    })
}

export function UpdateWarehouseCanenable(data: DelCustomerList) {
    return request({
        url: '/WarehouseData/UpdateWarehouseCanenable',
        method: 'post',
        data
    })
}

export function UpdateWarehouseDisable(data: DelCustomerList) {
    return request({
        url: '/WarehouseData/UpdateWarehouseDisable',
        method: 'post',
        data
    })
}

export function AddWarehouse(data: WarehouseData) {
    return request({
        url: '/WarehouseData/AddWarehouse',
        method: 'post',
        data
    })
}

export function GetHeadInfo() {
    return request({
        url: '/WarehouseData/GetHeadInfo',
        method: 'get',
    })
}

export function GetWarehouseInfo(data: FindWarehouseid) {
    return request({
        url: '/WarehouseData/GetWarehouseInfo?depot_id=' + data,
        method: 'get',
        data
    })
}

export function UpdateWarehouse(data: UpdateWarehouseData) {
    return request({
        url: '/WarehouseData/UpdateWarehouse',
        method: 'post',
        data
    })
}

